<template>
  <Form :model="data" :rules="rules" mode="twocolumn" ref="form" readonly>
    <FormItem label="发送号码" prop="phoneNumber">
      <Input type="text" v-model="data.phoneNumber" readonly/>
    </FormItem>
    <FormItem label="模板签名" prop="signName">
      <Input type="text" v-model="data.signName" readonly/>
    </FormItem>
    <FormItem label="模板编号" prop="templateCode">
      <Input type="text" v-model="data.templateCode" readonly/>
    </FormItem>
    <FormItem label="发送人" prop="createUser">
      <Input type="text" v-model="data.createUser" readonly/>
    </FormItem>
    <FormItem label="发送状态" prop="status">
      <Input type="text" v-model="data.status" readonly/>
    </FormItem>
    <FormItem label="说明" prop="memo">
      <Input type="text" v-model="data.memo" readonly/>
    </FormItem>
    <FormItem label="模板参数" prop="templateParam" single>
      <Textarea type="text" v-model="data.templateParam" style="height: 100px;resize: none" readonly/>
    </FormItem>
  </Form>
</template>
<script setup>
import {ajax} from 'framework'
import {ref, reactive} from 'vue'


//事件
//Props Open方法传入的参数
const {params, dialog} = defineProps({
  params: Object,
  dialog: Object
})

//dialog.cancel() 方法可以直接关闭对话框
//打开Dialog时进行初始化
let isAdd = false
if (params) {
  //通知Dialog处于loading状态
  dialog.loading(true)
  ajax.get("smsMessage/detail", params).then(r => {
    Object.assign(data, r.data)
    dialog.loading(false)
  })
} else {
  isAdd = true
}

//属性和状态
let form = ref(null)

//表单数据
const data = reactive({
  phoneNumber: null,
  signName: null,
  templateCode: null,
  templateParam: null,
  createUser: null,
  status: null,
  memo: null,
})

//验证规则
const rules = {}

/**
 * 提交数据
 */
dialog.onSubmit(() => {

})

</script>
